#include "array.h"
#include <iostream>
#include <cstring>

array::array(): n(4), x(0), im(0), jm(0)
{
	memset(p, 0, sizeof(p));
}

array::array(const array& pt): n(pt.n), x(pt.x), im(pt.im), jm(pt.jm)
{
	memcpy(p, pt.p, sizeof(p));
}

void array::input(int a[][4])
{
	for (int i =  0; i <= 3; i++) 
		for (int j =  0; j <= 3; j++) 
			p[i][j] = a[i][j];
	return ;
}

void array::find()
{
	for (int i =  0; i <= 3; i++) 
		for (int j =  0; j <= 3; j++) 
			if(p[i][j] > x)
			{
				x = p[i][j];
				im = i;
				jm = j;
			}

	return ;
}

void array::print()
{
	for (int i =  0; i <= 3; i++) 
	{
		for (int j =  0; j <= 3; j++) 
		{
			std::cout << p[i][j] << " ";
		}
		std::cout << "\n";
	}

	return ;
}
